package org.lvgo.builder.demo2;

/**
 * @author lvgo
 * @version 1.0
 * @Description: 人物角色
 * @date 18-8-21 下午4:37
 */
public class Person {


    private Eyes eyes;
    private Hair hair;
    private Leg leg;

    @Override
    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("我是个人");
        if (eyes != null) {
            stringBuilder.append(eyes.getCount()).append("个");
            stringBuilder.append(eyes.getColor()).append("的眼睛");
        }
        if (hair != null) {
            stringBuilder.append(",");
            stringBuilder.append(hair.getColor()).append("的头发");
        }
        if (leg != null) {
            stringBuilder.append(",").append(leg.getCount()).append("条腿");
        }
        return stringBuilder.toString();
    }

    public Eyes getEyes() {
        return eyes;
    }

    public void setEyes(Eyes eyes) {
        this.eyes = eyes;
    }

    public Hair getHair() {
        return hair;
    }

    public void setHair(Hair hair) {
        this.hair = hair;
    }

    public Leg getLeg() {
        return leg;
    }

    public void setLeg(Leg leg) {
        this.leg = leg;
    }
}
